package com.xiaoshuidi.cloud.module.report.convert.ajreport;

import com.xiaoshuidi.cloud.module.report.controller.ajreport.vo.ExchangeLedgerExportVO;
import com.xiaoshuidi.cloud.module.report.controller.ajreport.vo.RenewalLedgerExportVO;
import com.xiaoshuidi.cloud.module.report.controller.ajreport.vo.RentingLedgerExportVO;
import com.xiaoshuidi.cloud.module.report.controller.ajreport.vo.RentingOutLedgerExportVO;
import com.xiaoshuidi.cloud.module.report.dal.DO.report.ReportLedgerInfoDO;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.factory.Mappers;

import java.util.List;

/**
 * 台账报表 转换类
 */
@Mapper
public interface LedgerExportConvert {

    LedgerExportConvert INSTANCE = Mappers.getMapper(LedgerExportConvert.class);

    @Mapping(source = "startTime", target = "startTime", dateFormat = "yyyy-MM-dd")
    @Mapping(source = "endTime", target = "endTime", dateFormat = "yyyy-MM-dd")
    @Mapping(source = "rentDeliveryDate", target = "rentDeliveryDate", dateFormat = "yyyy-MM-dd")
    RentingLedgerExportVO convertRenting(ReportLedgerInfoDO infoDO);

    @Mapping(source = "startTime", target = "startTime", dateFormat = "yyyy-MM-dd")
    @Mapping(source = "endTime", target = "endTime", dateFormat = "yyyy-MM-dd")
    @Mapping(source = "newContractDate", target = "newContractDate", dateFormat = "yyyy-MM-dd")
    @Mapping(source = "firstContractDate", target = "firstContractDate", dateFormat = "yyyy-MM-dd")
    RenewalLedgerExportVO convertRenewal(ReportLedgerInfoDO infoDO);

    @Mapping(source = "startTime", target = "startTime", dateFormat = "yyyy-MM-dd")
    @Mapping(source = "endTime", target = "endTime", dateFormat = "yyyy-MM-dd")
    @Mapping(source = "rentDeliveryDate", target = "rentDeliveryDate", dateFormat = "yyyy-MM-dd")
    @Mapping(source = "oldStartTime", target = "oldStartTime", dateFormat = "yyyy-MM-dd")
    @Mapping(source = "oldEndTime", target = "oldEndTime", dateFormat = "yyyy-MM-dd")
    @Mapping(source = "newContractDate", target = "newContractDate", dateFormat = "yyyy-MM-dd")
    @Mapping(source = "firstContractDate", target = "firstContractDate", dateFormat = "yyyy-MM-dd")
    @Mapping(source = "oldSignedTime", target = "oldSignedTime", dateFormat = "yyyy-MM-dd")
    ExchangeLedgerExportVO convertExchange(ReportLedgerInfoDO infoDO);

    List<ExchangeLedgerExportVO>  covertExchange(List<ReportLedgerInfoDO> list);



    @Mapping(source = "startTime", target = "startTime", dateFormat = "yyyy-MM-dd")
    @Mapping(source = "endTime", target = "endTime", dateFormat = "yyyy-MM-dd")
    @Mapping(source = "evictionTime", target = "evictionTime", dateFormat = "yyyy-MM-dd")
    RentingOutLedgerExportVO convertRentingOut(ReportLedgerInfoDO infoDO);

}

